/**
 *
 */
package org.suren.littlebird.views.provider;

import org.eclipse.jface.viewers.ITableLabelProvider;
import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.swt.graphics.Image;
import org.suren.littlebird.po.SuRenLogger;

/**
 * @author suren
 * @since 2015-2-2
 */
public class SuRenLoggerFieldProvider extends LabelProvider implements
		ITableLabelProvider
{

	@Override
	public Image getColumnImage(Object ele, int index)
	{
		return null;
	}

	@Override
	public String getColumnText(Object ele, int index)
	{
		if(!(ele instanceof SuRenLogger))
		{
			return null;
		}

		SuRenLogger logger = (SuRenLogger) ele;
		switch(index)
		{
			case 0:
				return String.valueOf(logger.getIndex());
			case 1:
				return logger.getName();
			case 2:
				return logger.getLevel();
			case 3:
				return logger.getBridges();
		}

		return null;
	}

}
